#ifndef _WX_NOTEBOOK_H_BASE_
#define _WX_NOTEBOOK_H_BASE_

// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------

#include "wx/defs.h"

#if wxUSE_NOTEBOOK

#include "wx/bookctrl.h"

// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------

// wxNotebook hit results, use wxBK_HITTEST so other book controls can share them
// if wxUSE_NOTEBOOK is disabled
enum {
  wxNB_HITTEST_NOWHERE = wxBK_HITTEST_NOWHERE,
  wxNB_HITTEST_ONICON  = wxBK_HITTEST_ONICON,
  wxNB_HITTEST_ONLABEL = wxBK_HITTEST_ONLABEL,
  wxNB_HITTEST_ONITEM  = wxBK_HITTEST_ONITEM,
  wxNB_HITTEST_ONPAGE  = wxBK_HITTEST_ONPAGE
};

// wxNotebook flags

// use common book wxBK_* flags for describing alignment
#define wxNB_DEFAULT          wxBK_DEFAULT
#define wxNB_TOP              wxBK_TOP
#define wxNB_BOTTOM           wxBK_BOTTOM
#define wxNB_LEFT             wxBK_LEFT
#define wxNB_RIGHT            wxBK_RIGHT

#define wxNB_FIXEDWIDTH       0x0100
#define wxNB_MULTILINE        0x0200
#define wxNB_NOPAGETHEME      0x0400
#define wxNB_FLAT             0x0800


typedef wxWindow wxNotebookPage;  // so far, any window can be a page

extern const wxChar wxNotebookNameStr[];

class wxNotebookBase : public wxBookCtrlBase {
  public:
    wxNotebookBase() { }
    wxNotebookBase( wxWindow *parent,
                    wxWindowID winid,
                    const wxPoint& pos = wxDefaultPosition,
                    const wxSize& size = wxDefaultSize,
                    long style = 0,
                    const wxString& name = wxNotebookNameStr ) ;
    virtual int GetRowCount() const { return 1; }
    virtual void SetPadding( const wxSize& padding ) = 0;
    virtual void SetTabSize( const wxSize& sz ) = 0;
    virtual wxSize CalcSizeFromPage( const wxSize& sizePage ) const;
    virtual wxColour GetThemeBackgroundColour() const { return wxNullColour; }
    bool SendPageChangingEvent( int nPage );
    void SendPageChangedEvent( int nPageOld, int nPageNew = -1 );
  protected:
    DECLARE_NO_COPY_CLASS( wxNotebookBase )
};

class wxNotebookEvent : public wxBookCtrlBaseEvent {
  public:
    wxNotebookEvent( wxEventType commandType = wxEVT_NULL, int winid = 0,
                     int nSel = -1, int nOldSel = -1 )
      : wxBookCtrlBaseEvent( commandType, winid, nSel, nOldSel ) {
    }

    wxNotebookEvent( const wxNotebookEvent& event )
      : wxBookCtrlBaseEvent( event ) {
    }

    virtual wxEvent *Clone() const { return new wxNotebookEvent( *this ); }

  private:
    DECLARE_DYNAMIC_CLASS_NO_ASSIGN( wxNotebookEvent )
};

BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 802 )
DECLARE_EVENT_TYPE( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 803 )
END_DECLARE_EVENT_TYPES()

typedef void ( wxEvtHandler::*wxNotebookEventFunction )( wxNotebookEvent& );

#define wxNotebookEventHandler(func) \
  (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotebookEventFunction, &func)

#define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \
  wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, winid, wxNotebookEventHandler(fn))

#define EVT_NOTEBOOK_PAGE_CHANGING(winid, fn) \
  wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, winid, wxNotebookEventHandler(fn))

// ----------------------------------------------------------------------------
// wxNotebook class itself
// ----------------------------------------------------------------------------

#include  "wx/gtk/notebook.h"

#endif // wxUSE_NOTEBOOK

#endif
// _WX_NOTEBOOK_H_BASE_
